export default {
    mRoutePathPush(state, {url}) {
        state.routePath.push(url);
    },
    mRoutePathDel(state) {
        let i = state.routePath.length - 1;
        if (i > 0) {
            state.routePath.splice(i, 1)
        }
    },
    mBalance(state, {ETSC, ETH, SICBO}) {
        ETSC === '' && (ETSC = state.balance.ETSC);
        ETH === '' && (ETH = state.balance.ETH);
        SICBO === '' && (SICBO = state.balance.SICBO);
        state.balance = {ETSC, ETH, SICBO};
    },

    mCurrency(state, {BTC, ETH, ETSC, LTC, DASH, DOGE, QTUM, EOS, ADA, BTM, XRP, BTS}) {
        BTC === '' && (BTC = state.currency.BTC);
        ETH === '' && (ETH = state.currency.ETH);
        ETSC === '' && (ETSC = state.currency.ETSC);
        LTC === '' && (LTC = state.currency.LTC);
        DASH === '' && (DASH = state.currency.DASH);
        DOGE === '' && (DOGE = state.currency.DOGE);
        QTUM === '' && (QTUM = state.currency.QTUM);
        EOS === '' && (EOS = state.currency.EOS);
        ADA === '' && (ADA = state.currency.ADA);
        BTM === '' && (BTM = state.currency.BTM);
        XRP === '' && (XRP = state.currency.XRP);
        BTS === '' && (BTS = state.currency.BTS);
        state.currency = {BTC, ETH, ETSC, LTC, DASH, DOGE, QTUM, EOS, ADA, BTM, XRP, BTS};
    },

    mExchange(state, {rate = "", type = ""}) {
        rate === '' && (rate = state.exchange.rate);
        type === '' && (type = state.exchange.type);
        state.exchange = {rate, type};
    },
    mBackUrl(state, url) {
        state.backUrl = url;
    },

    mTransitionName(state, {transactionList}) {
        transactionList === '' && (transactionList = state.transitionName.transactionList);
        state.transitionName = {transactionList};
    }
}